<?php defined('SMIT_PATH') or die('Access Denied');
/**
 *	SmitCache.php - Caching layer
 *	This is Smit Matterhorn - Build 24109
 *	
 *
 * @author		The SmitBoard Team & Community
 * @license		GNU GPL v3
 * @link		http://smitboard.sf.net
 * @since		Matterhorn
 */
 
class cacheMaster
{
	public $base;

	public function __construct()
	{
		$this->base = SmitBase::getInstance();

		if(!$this->can_run())
		{
			$this->base->error('Unable to load cache driver "' . $this->driver . '" due to a missing dependency "' . $this->dependency . '"', E_CACHE);
		}
	}

	function can_run()
	{
		if(isset($this->dependency) && $this->dependency != NULL)
		{
			$extensions = array();
			foreach (get_loaded_extensions() as $ext)
			{
				$extensions[] = strtolower($ext);
			}
			return in_array($this->dependency, $extensions);
		}
		return TRUE;
	}

	function add($key, $data)
	{
		die('The following function is missing in your cache driver: add()');
	}
	
	function get($key)
	{
		die('The following function is missing in your cache driver: get()');
	}

	function delete($key)
	{
		die('The following function is missing in your cache driver: delete()');
	}
}

?>